-- Keymaps are automatically loaded on the VeryLazy event
-- Default keymaps that are always set: https://github.com/LazyVim/LazyVim/blob/main/lua/lazyvim/config/keymaps.lua
-- Add any additional keymaps here
local map = vim.keymap.set

-- escape
map({ "i", "v" }, ";j", "<ESC>", { desc = "switch to nmap" })

-- move
map("i", "<c-a>", "<home>", { desc = "move to home" })
map("i", "<c-e>", "<end>", { desc = "move to end" })
map("i", "<c-b>", "<left>", { desc = "move to left" })
map("i", "<c-f>", "<right>", { desc = "move to right" })

-- window
map("n", "<leader>wo", "<cmd>only<cr>", { desc = "window only" })

-- terminal
map("n", "<C-\\>", function()
  LazyVim.terminal()
end, { desc = "Terminal (cwd)" })

map("t", "<c-\\>", "<cmd>close<cr>", { desc = "Hide ternimal" })
map("t", "<c-h>", "<backspace>", { desc = "backspace" })

-- test
map({ "n" }, "<C-m>", function()
  LazyVim.info(vim.fn.expand("%:p:h"))
end)
